package com.example.demo.http;

import com.alibaba.fastjson.JSONObject;
import com.example.demo.utils.HttpClientProxy;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;

/**
 * @desc: <br/>
 * @author: Jingbo Hu<br/>
 * @time：2020年08⽉27⽇<br/>
 * @version：v1.0.0<br>
 */
@Slf4j
public class CallbackDemo {


    public static void main(String[] args) {
        try {
            String callbackUrl = "http://127.0.0.1:8089/demo/notify";
            Map<String, String> params = new HashMap<>(16);
            JSONObject jsonObj = new JSONObject();
            jsonObj.put("retCode", 0);
            jsonObj.put("retMsg","success");
            jsonObj.put("fileUri", "4945E8FF6009D7A65FA3D52370492666");
            params.put("jsonData", jsonObj.toJSONString());
            log.info("回调业务系统消息：" + params.toString());
            log.info("-----------------------------------------------");
            String result = HttpClientProxy.post(callbackUrl, params);
            log.info("回调业务系统成功...... 响应结果={}", result);
        } catch (Exception e) {
            log.info("回调业务系统失败......", e);
        }
    }
}
